﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WsdShop.Model.Enum;

namespace WsdShop.Model.ViewModels.Draw
{
    //显示在DrawList
    public class DrawVM:Model.Draw
    {
        /// <summary>
        /// 上架状态
        /// </summary>
        public string DrawStatus
        {
            get { return IsDisplay ? "已上架" : "已下架"; }
        }

        /// <summary>
        /// 中奖人数
        /// </summary>
        public int GetPersonCount { get; set; }

        /// <summary>
        /// 奖项数量
        /// </summary>
        public int PrizeCount { get; set; }

        public string ChancesM
        {
            get
            {
                return Chances == 0 ? "不限" : Chances.ToString();
            }
        }

    }

    public class DrawRewardVM : Model.DrawReward
    {
        public string RewardTypeStr
        {
            get
            {
                if(RewardType == RewardType.优惠券)
                {
                    return "优惠券";
                }
                else if (RewardType == RewardType.实体商品)
                {
                    return "实体商品";
                }
                else if(RewardType == RewardType.奖励积分)
                {
                    return "奖励积分";
                }
                else { return ""; }
            }
        }
    }

    public class ProductVM
    {
        public string Name { get; set; }

        public int Id { get; set; }
    }

    public class DrawRecordVM:DrawRecord
    {
        public string IsWinningM { get { return IsWinning ? "中奖" : "未中奖"; } }

        public string RewardTypeM
        {
            get
            {
                if (RewardType == RewardType.优惠券)
                {
                    return "优惠券";
                }
                else if (RewardType == RewardType.实体商品)
                {
                    return "实体商品";
                }
                else if (RewardType == RewardType.奖励积分)
                {
                    return "奖励积分";
                }
                else { return "---"; }
            }
        }

        public string ProductNumM
        {
            get
            {
                if(RewardType==RewardType.奖励积分)
                {
                    return ProductNum.ToString();
                }
                else
                {
                    return "---";
                }
            }
        }

        public string StepTypeM
        {
            get
            {
                if (StepType == StepType.已发放)
                    return "已发放";
                if (StepType == StepType.待发放)
                    return "待发放";
                if (StepType == StepType.待确认收货地址)
                    return "未确认发货地址";
                else
                    return "---";
            }
        }

        public string DrawRewardNameM
        {
            get { return IsWinning ? DrawRewardName : "---"; }
        }

        public string ProvinceM
        {
            get
            {
                return string.IsNullOrWhiteSpace(Province) ? "---" : Province;
            }
        }
        public string CityM
        {
            get
            {
                return string.IsNullOrWhiteSpace(City) ? "---" : City;
            }
        }
        public string DistrictM
        {
            get
            {
                return string.IsNullOrWhiteSpace(District) ? "---" : District;
            }
        }

        public string AddressM
        {
            get
            {
                return string.IsNullOrWhiteSpace(Address) ? "---" : Address;
            }
        }

        public string MobileM
        {
            get
            {
                return string.IsNullOrWhiteSpace(Mobile) ? "---" : Mobile;
            }
        }       
    }

    public class ProStepVM : Product_Spec
    {
        public string ProductName { get; set; }
    }
}
